<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    setInterval(f,10);

    function f() {
        //alert("时间到")
        console.log("时间到")
    }
    setInterval(function () {
        console.log("第二种")
    },20)
    let count = 0
    let timer = setInterval(function () {
        console.log("第二种")
        count++
        if (count==3){
            clearInterval(timer)
        }
    })
</script>
</body>
</html>